﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using Cirrious.MvvmCross.ViewModels;
using Cirrious.MvvmCross.Wpf.Interfaces;
using TeaLightV5.Foundation.UX.Wpf.MvvmCross.Views;

namespace TealightV5.UI.WPF
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();
        }

        public void Present(FrameworkElement toShow)
        {
            TheGrid.Children.Clear();
            TheGrid.Children.Add(toShow);
        }

        public TeaWpfViewPresenter Presenter { get; set; }

        private void ButtonBase_OnClick(object sender, RoutedEventArgs e)
        {
            Presenter.Back();

            //if (TheGrid.Children.Count > 0)
            //{
            //    IMvxWpfView view = TheGrid.Children[0] as IMvxWpfView;

            //    if (view != null)
            //    {
            //        MvxViewModel viewModel = view.ViewModel as MvxViewModel;
            //        if (viewModel != null)
            //            viewModel.CloseCommand.Execute(null);
            //    }
            //}
        }
    }

}
